package com.itheima_04;

import java.util.Scanner;

//获取较大值：设计一个方法获取两个数的较大值，数据来自于参数
public class getMaxNumber {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第一个整数：");
        int num1 = sc.nextInt();
        System.out.println("请输入第二个整数：");
        int num2 = sc.nextInt();
        int max = getMax(num1, num2);
        System.out.println("max:" + max);
    }

    private static int getMax(int num1, int num2) {
        int max = 0;
        if (num1 < num2) {
            max = num2;
        } else {
            max = num1;
        }
        return max;
    }
}
